package com.woniuxy.entity;

import java.io.Serializable;
import java.util.Date;

public class Cart implements Serializable {
    private Integer id;
    private Integer userid;
    private Integer goodsid;
    private Integer nums;
    private Double price;
    private Date addtime =new Date();
    private Goods goods;
    private User user;

    public Cart(Integer userid, Integer goodsid, Integer nums, Double price) {
        this.userid = userid;
        this.goodsid = goodsid;
        this.nums = nums;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", userid=" + userid +
                ", goodsid=" + goodsid +
                ", nums=" + nums +
                ", price=" + price +
                ", addtime=" + addtime +
                ", goods=" + goods +
                ", user=" + user +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public Integer getGoodsid() {
        return goodsid;
    }

    public void setGoodsid(Integer goodsid) {
        this.goodsid = goodsid;
    }

    public Integer getNums() {
        return nums;
    }

    public void setNums(Integer nums) {
        this.nums = nums;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Date getAddtime() {
        return addtime;
    }

    public void setAddtime(Date addtime) {
        this.addtime = addtime;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Cart() {
    }

    public Cart(Integer id, Integer userid, Integer goodsid, Integer nums, Double price, Date addtime, Goods goods, User user) {
        this.id = id;
        this.userid = userid;
        this.goodsid = goodsid;
        this.nums = nums;
        this.price = price;
        this.addtime = addtime;
        this.goods = goods;
        this.user = user;
    }
}
